package zsc.ruanc.practicaltraining.model.domain;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 文章评论表
 */
@Data
public class TComment {

  @Min(message = "id不能为小于0", value = 0)
  @ApiModelProperty(value = "评论id，自增主键", required = true, dataType = "int")
  private Integer id;

  @NotNull(message = "articleId不能为空")
  @Min(message = "articleId不能为小于0", value = 0)
  @ApiModelProperty(value = "关联的文章id，外键", required = true, dataType = "int")
  private Integer articleId;

  @ApiModelProperty(value = "创建时间", required = false, dataType = "Date")
  private Date created;

  @ApiModelProperty(value = "ip地址", required = false, dataType = "string")
  private String ip;

  @NotBlank(message = "content不能为空")
  @ApiModelProperty(value = "评论内容", required = true, dataType = "string")
  private String content;

  @ApiModelProperty(value = "评论作者", required = true, dataType = "string")
  private String author;

  //点赞数
  @ApiModelProperty(value = "点赞数", required = true, dataType = "int")
  private Integer likes;

  @ApiModelProperty(value = "ip对应的实际地址", required = true, dataType = "String")
  private String address;




}
